package com.xj.common.bean.em;

public enum ControlStateEm {

    CTL_STATE_RECEIVED(1,"已接收"),
    CTL_STATE_RESPONSE(2,"设备已回复"),
    CTL_STATE_TIMEOUT(3,"控制超时"),
    CTL_STATE_ERROR(3,"控制错误");

    private int code;
    private String msg;
    ControlStateEm(int code , String msg){
        this.code = code;
        this.msg = msg;
    }
    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static ControlStateEm getControlStateEm(int code){
        ControlStateEm[] ems = ControlStateEm.values() ;
        for(ControlStateEm em:ems){
            if(em.getCode() == code){
                return em;
            }
        }

        return null;
    }
}
